package com.hpsk.shopservice.model.config.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.*;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author huangwang
 * @since 2024-12-31
 */
@Schema(description = "用户实体类")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UserDto {

    @Schema(description = "姓名",requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "姓名不能为空")
    private String name;

    @Schema(description = "年龄",requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "年龄不能为空")
    @Min(value = 1,message = "年龄不能小于1")
    @Max(value = 200,message = "年龄不能大于200")
    private Integer age;

    @Schema(description = "邮箱")
    @Email(message = "必须为邮件格式")
    private String email;

    @Schema(description = "手机号",requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "手机号不能为空")
    @Length(min = 11,max = 11,message = "手机号必须为11位")
    private String phone;

    @Schema(description = "头像")
    @NotBlank(message = "头像不能为空")
    private String avatar;
}
